package com.zhiyou.app.common.ws;

import lombok.Data;

import java.util.List;

/**
 * ComfyuiTaskInfo
 *
 * @author zhangqiang
 */
@Data
public class ComfyuiTaskInfo {
    private String task_id;
    private String status;
    private QueueInfo queue;
    private CurrentTaskProgress current_task_progress;
    private Object current_task_outputs;
    private Object error_info;
    private WorkflowProgress workflow_progress;
    private double execution_time;

    @Data
    // 内部类：QueueInfo
    public static class QueueInfo {
        private int running_count;
        private int pending_count;
        private List<TaskItem> running;
        private List<TaskItem> pending;
    }

    @Data
    // 内部类：TaskItem (用于running和pending列表)
    public static class TaskItem {
        private String prompt_id;
        private int nodes_in_prompt;
        private String client_id;
    }

    @Data
    // 内部类：CurrentTaskProgress
    public static class CurrentTaskProgress {
        private String node_id;
        private String node_type;
        private int step;
        private int total_steps;
        private Object text_message;
    }

    @Data
    // 内部类：WorkflowProgress
    public static class WorkflowProgress {
        private int total_nodes;
        private int executed_nodes;
        private String last_executed_node_id;
    }
}

